The present invention relates to the field of computer graphics. Many computer graphic images are created by mathematically modeling the interaction of light with a three dimensional scene from a given viewpoint. This process, called rendering, generates a two-dimensional image of the scene from the given viewpoint, and is analogous to taking a photograph of a real-world scene.
As the demand for computer graphics, and in particular for real-time computer graphics, has increased, computer systems with graphics processing subsystems adapted to accelerate the rendering process have become widespread. In these computer systems, the rendering process is divided between a computer's general purpose central processing unit (CPU) and the graphics processing subsystem. Typically, the CPU performs high level operations, such as determining the position, motion, and collision of objects in a given scene. From these high level operations, the CPU generates a set of rendering commands and data defining the desired rendered image or images. For example, rendering commands and data can define scene geometry, lighting, shading, texturing, motion, and/or camera parameters for a scene. The graphics processing subsystem creates one or more rendered images from the set of rendering commands and data.
During rendering, the graphics processing subsystem typically stores the rendered image in one or more memory buffers. The rendered image is then periodically read from memory buffer and output to a display device. To create animation, the graphics processing subsystem must generate a large number of successive images. The graphics processing subsystem typically creates each rendered image and stores the rendered image in a memory buffer just prior to its output to a display device. Before storing a rendered image in a memory buffer, the graphics processing subsystem must clear the data from any previously rendered images stored in the memory buffer.
Clearing memory buffers typically involves overwriting previous image data with a default value, such as a background color or a default depth, stencil, or alpha value. Previously, graphics processing subsystems would need to clear the entire memory buffer between successive images. As image resolutions, which increase the memory buffer size, and frame rates have increased, the time needed to clear the memory buffers has become a large factor in overall rendering performance. Further, many rendering applications, referred to as three-dimensional modeling applications, typically render one or more objects in isolation, leaving most of the image unchanged from its default values.
It is desirable for a graphics processing subsystem to decrease the amount of time spent clearing memory buffers by avoiding memory writes to portions of the memory buffers unchanged from their default values. It is further desirable that the improved graphics processing subsystem be adaptable to a variety of different rendering methods and to be compatible with existing rendering applications, graphics rendering APIs, and operating systems.